// import { http } from '../utils/request.js';
// 用户
import http from '~/utils/request.js'

let app = getApp();

var url = {
    profirst: "base/mainCategory/list",
    // 上为测试
    admin_oss_file_upload: "base/admin/oss/file/upload",
    // login
    login: "base/applet-user/login",
    indexbanner: "public/banner",
    indexcommlist: "public/choiceness",
    particulars: "public/particulars",

    // 供应商申请
    applycompany: "base/ms-company/add",

    // 申请状态
    timecompanystart: "base/applet-user/get/message",

    gatusermess: "base/applet-user/get/message",
    updatauser: "base/applet-user/get/update",

    proexpress: "base/pro/express",

    teamleader: "base/applet-head/get/headName/more",
    regimentalSearch:"base/applet-head/get/headName",
    applyhead:"base/applet-head/get/By/approve",

    manyConditions:"public/explosiveGoods/manyConditions",

    SelectionLibrary:"public/SelectionLibrary/search",

    selectByDay:"public/selectByDay",
    collectrecord:"base/red-collect-record/add",
    
    
    getmyfollow:"base/applet-store-follow/get/my/headName",
    getmyrecord:"base/red-collect-record/get/my/headName",
    getmyapplet:"base/applet-head-follow/get/my/headName",

    updateuser:"base/applet-user/get/update",
    
    getcde:"base/applet-head-approve/get/code",

    getSearch:'public/search',

    getScreen:'base/mainCategory/list',
    // 爆品榜搜索
    explosivesSearch:'public/explosiveGoods/search',
    // 价格列表
    priceList:'base/applet-price/getList',
    // 获取佣金
    brokerage:'base/applet-price/getList/brokerage'
}

let adminossfileupload = url.admin_oss_file_upload
let profirst = () => {
    return http({
        url: url.profirst,
        header: {
            "Content-Type": "application/x-www-form-urlencoded"
        }
    })
}
let login = (data) => {
    return http({
        url: url.login,
        method: "POST",
        data: data,
        header: {
            "Content-Type": "application/x-www-form-urlencoded"
        }
    })
}
let indexbanner = () => {
    return http({
        url: url.indexbanner,
        method: "GET",
        header: {
            'content-type': 'application/json'
        }
    })
}
let indexcommlist = (data) => {
    return http({
        url: url.indexcommlist,
        method: "GET",
        data: data,
        header: {
            'content-type': 'application/json'
        }
    })
}

let particulars = (data) => {
    return http({
        url: url.particulars,
        method: "GET",
        data: data,
        header: {
            'content-type': 'application/json'
        }
    })
}


let applycompany = (data) => {
    return http({
        url: url.applycompany,
        method: "POST",
        data: data,
        settoken: true,
        header: {
            'content-type': 'application/json'
        }
    })
}
let timecompanystart = () => {
    return http({
        url: url.timecompanystart,
        method: "GET",
        settoken: true,
        header: {
            'content-type': 'application/json'
        }
    })
}
let gatusermess = () => {
    return http({
        url: url.gatusermess,
        header: {
            'content-type': 'application/json'
        }
    })
}
let updatauser = (data) => {
    return http({
        url: url.updatauser,
        data: data,
        method: "GET",
        settoken: true,
        header: {
            'content-type': 'application/json'
        }
    })
}
let proexpress = (data) => {
    return http({
        url: url.proexpress,
        data: data,
        method: "GET",
        header: {
            'content-type': 'application/json'
        }
    })
}
let teamleader = (data) => {
    return http({
        url: url.teamleader,
        data: data,
        method: "GET",
        header: {
            'content-type': 'application/json'
        }
    })
}
let applyhead = (data) => {
    return http({
        url: url.applyhead,
        data: data,
        method: "GET",
        header: {
            'content-type': 'application/json'
        }
    })
}
let manyConditions = (data) => {
    return http({
        url: url.manyConditions,
        data: data,
        method: "GET",
        header: {
            'content-type': 'application/json'
        }
    })
}
let SelectionLibrary = (data) => {
    return http({
        url: url.SelectionLibrary,
        data: data,
        method: "GET",
        header: {
            'content-type': 'application/json'
        }
    })
}
let selectByDay = (data) => {
    return http({
        url: url.selectByDay,
        data: data,
        method: "GET",
        header: {
            'content-type': 'application/json'
        }
    })
}
let collectrecord= (data) => {
    return http({
        url: url.collectrecord,
        data: data,
        method: "POST",
        header: {
            'content-type': 'application/json'
        }
    })
}
let getmyfollow= (data) => {
    return http({
        url: url.getmyfollow,
        data: data,
        method: "GET",
        settoken: true,
        header: {
            'content-type': 'application/json'
        }
    })
}

let getmyrecord= (data) => {
    return http({
        url: url.getmyrecord,
        data: data,
        method: "GET",
        settoken: true,
        header: {
            'content-type': 'application/json'
        }
    })
}

let getmyapplet= (data) => {
    return http({
        url: url.getmyapplet,
        data: data,
        method: "GET",
        settoken: true,
        header: {
            'content-type': 'application/json'
        }
    })
}
let updateuser = (data) => {
    return http({
        url: url.updateuser,
        data: data,
        method: "GET",
        settoken: true,
        header: {
            'content-type': 'application/json'
        }
    })
}
let getcde= () => {
    return http({
        url: url.getcde,
        header: {
            'content-type': 'application/json'
        }
    })
}
let getSearch = (data) => {
  return http({
      url: url.getSearch,
      method: "GET",
      data: data,
      header: {
          "Content-Type": "application/x-www-form-urlencoded"
      }
  })
}
let getScreen = (data) => {
  return http({
      url: url.getScreen,
      method: "GET",
      data: data,
      header: {
          "Content-Type": "application/x-www-form-urlencoded"
      }
  })
}
let explosivesSearch = (data) => {
  return http({
      url: url.explosivesSearch,
      method: "GET",
      data: data,
      header: {
          "Content-Type": "application/x-www-form-urlencoded"
      }
  })
}
let regimentalSearch = (data) => {
  return http({
      url: url.regimentalSearch,
      method: "GET",
      data: data,
      header: {
          "Content-Type": "application/x-www-form-urlencoded"
      }
  })
}
let priceList = (data) => {
  return http({
      url: url.priceList,
      method: "GET",
      data: data,
      header: {
          "Content-Type": "application/x-www-form-urlencoded"
      }
  })
}
let brokerage = (data) => {
  return http({
      url: url.brokerage,
      method: "GET",
      data: data,
      header: {
          "Content-Type": "application/x-www-form-urlencoded"
      }
  })
}
module.exports = {
    adminossfileupload,
    profirst,
    login,
    indexbanner,
    indexcommlist,
    particulars,
    applycompany,
    timecompanystart,
    gatusermess,
    updatauser,
    proexpress,
    teamleader,
    applyhead,
    manyConditions,
    SelectionLibrary,
    selectByDay,
    collectrecord,

    getmyfollow,
    getmyrecord,
    getmyapplet,

    getcde,

    getSearch,
    getScreen,
    explosivesSearch,
    regimentalSearch,
    priceList,
    brokerage
}

// export const userLogin = (data) => {
//     // console.log(http)
//     return http({
//       url: '/ipStrainer/createIpFilter',
//       method: 'post',
//       data
//     })
//   }